package org.example.feign;

import io.swagger.annotations.ApiParam;
import org.example.request.LockCouponRecordRequest;
import org.example.util.JsonData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "xdclass-coupon-service")
public interface CouponRecordFeignService {

    /**
     * 根据record_id查询优惠券
     */
    @GetMapping("/api/coupon_record/v1/detail/{record_id}")
    JsonData detail(@PathVariable(value = "record_id", required = true) Long recordId);

    /**
     * 锁定优惠券记录
     */
    @PostMapping("/api/coupon_record/v1/lock_records")
    JsonData lockCouponRecords(@RequestBody LockCouponRecordRequest recordRequest);

}
